From 31f1ce4923d87282875dc0df2d8d2c649fa87911 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Fri, 12 Aug 2005 09:14:02 +0000 Subject: [PATCH] Rearrange code in __start_xen() to work around internal compiler error in x86/64 gcc. Signed-off-by: Keir Fraser --- xen/arch/x86/setup.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index fcf7f522b8..070a9127b2 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -336,26 +336,25 @@ void __init __start_xen(multiboot_info_t *mbi) /* Find a large enough RAM extent to stash the DOM0 modules. */ for ( i = 0; ; i++ ) { - if ( (e820.map[i].type == E820_RAM) && - (e820.map[i].size >= modules_length) && - ((e820.map[i].addr + e820.map[i].size) >= - (xenheap_phys_end + modules_length)) ) - { - /* Stash as near as possible to the beginning of the RAM extent. */ - initial_images_start = e820.map[i].addr; - if ( initial_images_start < xenheap_phys_end ) - initial_images_start = xenheap_phys_end; - initial_images_end = initial_images_start + modules_length; - break; - } - if ( i == e820.nr_map ) { printk("Not enough memory to stash the DOM0 kernel image.\n"); for ( ; ; ) ; } + + if ( (e820.map[i].type == E820_RAM) && + (e820.map[i].size >= modules_length) && + ((e820.map[i].addr + e820.map[i].size) >= + (xenheap_phys_end + modules_length)) ) + break; } + /* Stash as near as possible to the beginning of the RAM extent. */ + initial_images_start = e820.map[i].addr; + if ( initial_images_start < xenheap_phys_end ) + initial_images_start = xenheap_phys_end; + initial_images_end = initial_images_start + modules_length; + #if defined(CONFIG_X86_32) memmove((void *)initial_images_start, /* use low mapping */ (void *)mod[0].mod_start, /* use low mapping */ -- 2.30.2